package com.ljx.pojo.vo;

import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Component;

/**
 * @author 李加喜
 * @date 2020/9/30 0030 17:34
 * @Email 1129071273@qq.com
 */
@Component
public class ConstantWxUtils implements InitializingBean {
    @Value("${wx.open.app_id}")
    private String appId;
    @Value("${wx.open.app_secret}")
    private String keyid;
    @Value("${wx.open.redirect_url}")
    private String url;
    //定义公开静态常量
    public static String WX_APP_ID;
    public static String WX_APP_SECRET;
    public static String WX_REDIRECT_URL;
    //会在这些属性获取值之后进行执行
    @Override
    public void afterPropertiesSet() throws Exception {
        WX_APP_ID=appId;
        WX_APP_SECRET=keyid;
        WX_REDIRECT_URL=url;
    }
}
